﻿@model List<UserRoleViewModel>
@{ var roleId = ViewBag.roleId; }

<form method="post">
    <div class="card">
        <div class="card-header">
            <h2>在此角色中添加或删除用户</h2>
        </div>
        <div class="card-body">
            @for (int i = 0; i < Model.Count; i++)
            {
                <div class="form-check m-1">
                    <input type="hidden" asp-for="@Model[i].UserId" />
                    <input type="hidden" asp-for="@Model[i].UserName" />
                    <input asp-for="@Model[i].IsSelected" class="form-check-input" />
                    <label class="form-check-label" asp-for="@Model[i].IsSelected">
                        @Model[i].UserName
                    </label>
                </div>
            }
        </div>
        <div class="card-footer">
            <input type="submit"
                   value="更新"
                   class="btn btn-primary"
                   style="width:auto" />
            <a asp-action="EditRole"
               asp-route-id="@roleId"
               class="btn btn-primary"
               style="width:auto">取消</a>
        </div>
    </div>
</form>